package com.nightpiter.model.reader.xml.dom;

import com.nightpiter.model.MetroModelBuilder;
import com.nightpiter.model.objects.Time;

/**
 * Wrapper for MetroModelBuilder to use it with DomReader class
 * 
 * @author Eldar Abusalimov (eldar.abusalimov@gmail.com)
 */
public class DomBuilderWrapper {

	private MetroModelBuilder builder;

	public DomBuilderWrapper(MetroModelBuilder modelBuilder) {
		this.builder = modelBuilder;
	}

	public void addStation(int id, String name, int positionX, int positionY,
			int locationX, int locationY, Time open, Time close) {
		builder.startStation(id);
		builder.setStationName(name);
		builder.setStationPosition(positionX, positionY);
		builder.setStationLocation(locationX, locationY);
		builder.setStationSchedule(open, close);
		builder.endStation();
	}

	public void addLine(int id, String name, int color) {
		builder.startLine(id);
		builder.setLineName(name);
		builder.setLineColor(color);
		builder.endLine();
	}

	public void addTunnel(int from, int to, int line, int time) {
		builder.addTunnel(to, from, time, line);
	}

	public void addTransfer(int from, int to, int time) {
		builder.addTransfer(to, from, time);
	}
}
